﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.IO;
using Newtonsoft.Json.Linq;
using System.Diagnostics;

namespace Core.Rules
{
    public class PositiveWordsFromOthers_Rule : PositiveWords
    {
        public override double apply( SiteEnum site, QuestionInformation info)
        {  
            double confidence = 0;

            foreach (Reply reply in info.Replies)
            {
                if (reply.Author != info.Question.Author)
                {
                    double sentiment = ExecuteAlchemyAPI(reply.ReplyText);
                    confidence += sentiment;
                }
            }

            return confidence;            
        }      

        public override string RuleName
        {
            get { return "PositiveWordsFromOthers_Rule"; }
        }
    }
}
